<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="javabean.Conn" %>
    <%@ page import="java.sql.*" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>alter_deal</title>
</head>
<body>
<%
try{
	if(request.getParameter("interest").equals("")){
		out.print("Please enter your interest.");
	}
	else{
	Object obj=session.getAttribute("login_name");
	String login_name=obj.toString();
	
	Connection conn=Conn.connect();
	String updatesql="update wuqiantong set interest=? where name=?";
	PreparedStatement ps=conn.prepareStatement(updatesql);
	ps.setString(1,request.getParameter("interest"));
	ps.setString(2,login_name);
	int row=ps.executeUpdate();
	if(row>0){
		out.print("Alter successfully!");
	}
    ps.close();
    conn.close();
	}
}
catch(Exception e){
	e.printStackTrace();
	out.print("Alter failed.");
}
%>
<a href="alter.jsp">back</a>
<a href="main.jsp">main</a>
</body>
</html>